//
//  SKNavigationBar.m
//  SouthKoreaDoorLock
//
//  Created by Umeinfo on 2018/1/17.
//  Copyright © 2018年 andy90s. All rights reserved.
//

#import "SKNavigationBar.h"

@implementation SKNavigationBar

- (void)layoutSubviews
{
    [super layoutSubviews];
    NSInteger naviBarHeight;
    NSInteger statusBarHeight;
    if (k_iPhoneX) {
        naviBarHeight = 88;
        statusBarHeight = 44;
    } else {
        naviBarHeight = 64;
        statusBarHeight = 20;
    }
    
    self.frame = CGRectMake(0, 0, CGRectGetWidth(self.frame), naviBarHeight);
    for (UIView *view in self.subviews) {
        if([NSStringFromClass([view class]) containsString:@"Background"]) {
            view.frame = self.bounds;
        }
        else if ([NSStringFromClass([view class]) containsString:@"ContentView"]) {
            CGRect frame = view.frame;
            frame.origin.y = statusBarHeight;
            frame.size.height = self.bounds.size.height - frame.origin.y;
            view.frame = frame;
        }
    }

}



@end
